<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>

    <body>
        <!-- 有一个从小到大排好序的数组。现输入一个数，要求按原来的规律将它插入数组中。 -->
        <script>
            var arr = [3, 8, 5, 9, 2, 6]
            arr.sort(function(a, b) {
                return a - b
            })
            console.log(arr);
        </script>
    </body>

    </html>
</body>

</html>